# -*- coding: utf-8 -*-
# @Time    : 2022/7/18 10:42
# @Author  : Yanfeng
# @Email   : sxyanfeng2014@163.com
# @File    : logger.py
# @Software: PyCharm
from Common.dir_config import ConfigHandler


from loguru import logger
import time


class Logger:
    __log_path = ConfigHandler.log_dir
    logger.add(f"{__log_path}/{time.strftime('%Y%m%d')}.log", rotation="500MB",
               encoding="utf-8", enqueue=True,
               retention="10 days")

    @staticmethod
    def info(msg):
        return logger.info(msg)

    @staticmethod
    def debug(msg):
        return logger.debug(msg)

    @staticmethod
    def warning(msg):
        return logger.warning(msg)

    @staticmethod
    def error(msg):
        return logger.error(msg)
    @staticmethod
    def exception(msg):
        return  logger.exception(msg)

if __name__ == '__main__':
    Logger.debug("a")